﻿/*
 * ========================================================================
 * Copyright(c) 2008-2010北京高阳金信信息技术有限公司, All Rights Reserved.
 * ========================================================================
 *  基金行情WCF服务
 * 
 * 作者：邓太华     时间：2010-06-04
 * 版本：V1.0
 * 
 * 修改者：马德强         时间：  2010-06-22              
 * 修改说明：增加基金行情相关算法
 * ========================================================================
*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Activation;
using System.ServiceModel.Web;
using NBFBLL;

namespace NBFWcfService
{
    /// <summary>
    /// 基金行情服务类
    /// </summary>
    [AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
    public class FundMarketService : IFoundMarket
    {
       

        #region IFoundMarket 成员

        /// <summary>
        /// 获取基金行情数据
        /// </summary>
        /// <returns></returns>
        [WebGet(BodyStyle = WebMessageBodyStyle.WrappedRequest , ResponseFormat = WebMessageFormat.Json)] 
        public List < NBFModel.Model_FoundMarket> GetFoundMarket()
        {
            FundMarket market = new FundMarket();
            return  market.GetFundMarket();

           
        }

        /// <summary>
        /// 获取基金行情数据(以数组方式）
        /// </summary>
        /// <returns></returns>
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
        public NBFModel.Model_FoundMarket[] GetFoundMarketArray()
        {
            FundMarket market = new FundMarket();
            

            NBFModel.Model_FoundMarket[] list = new NBFModel.Model_FoundMarket [1];
            NBFModel.Model_FoundMarket item = new NBFModel.Model_FoundMarket();
           
            return list;
        }

        /// <summary>
        /// 获取基金详细净值数据绑定到K图用
        /// </summary>
        /// <param name="jjdm">基金系统代码</param>
        /// <returns></returns>
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] 
        public List<NBFModel.FundDetailsInfo> GetFundDetailsInfo(string jjdm)
        {
            FundMarket market = new FundMarket();
            return market.GetFundDetailsInfo(jjdm);
        }

        /// <summary>
        /// 获取基金公告
        /// </summary>
        /// <param name="jjdm">系统基金代码</param>
        /// <returns></returns>
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)] 
        public List<NBFModel.Model_Announcement> GetFundAnnouncement(string jjdm)
        {
            FundMarket market = new FundMarket();
            return market.GetFundAnnouncemen(jjdm);
        }

        /// <summary>
        /// 获取基金新闻
        /// </summary>
        /// <param name="jjdm">系统基金代码</param>
        /// <returns></returns>
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
        public List<NBFModel.Model_News> GetFundNews(string jjdm)
        {
            FundMarket market = new FundMarket();
            return market.GetFundNews(jjdm);
        }

        /// <summary>
        /// 获取基金概况（取得的结果需经过拆分方可使用）
        /// </summary>
        /// <param name="jjdm">系统基金代码</param>
        /// <returns></returns>
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
        public List<NBFModel.Model_Overview> GetFundOverview(string jjdm)
        {
            FundMarket market = new FundMarket();
            return market.GetFundOverview(jjdm);
        }

        /// <summary>
        /// 获取基金分红
        /// </summary>
        /// <param name="jjdm">系统基金代码</param>
        /// <returns></returns>
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
        public List<NBFModel.Model_Dividend> GetFundDividend(string jjdm)
        {
            FundMarket market = new FundMarket();
            return market.GetFundDividend(jjdm);
        }

        /// <summary>
        /// 获取基金拆分
        /// </summary>
        /// <param name="jjdm">系统基金代码</param>
        /// <returns></returns>
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
        public List<NBFModel.Model_Split> GetFundSplit(string jjdm)
        {
            FundMarket market = new FundMarket();
            return market.GetFundSplit(jjdm);
        }

        /// <summary>
        /// 获取基金经理信息
        /// </summary>
        /// <param name="jjdm">系统基金代码</param>
        /// <returns></returns>
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
        public List<NBFModel.Model_FundManager> GetFundManager(string jjdm)
        {
            FundMarket market = new FundMarket();
            return market.GetFundManager(jjdm);
        }

        /// <summary>
        /// 获取基金申购赎回信息
        /// </summary>
        /// <param name="jjdm">系统基金代码</param>
        /// <returns></returns>
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
        public List<NBFModel.Model_BuyAndSale> GetFundBuyAndSale(string jjdm)
        {
            FundMarket market = new FundMarket();
            return market.GetFundBuyAndSale(jjdm);
        }

        /// <summary>
        /// 获取基金行业配置信息
        /// </summary>
        /// <param name="jjdm">系统基金代码</param>
        /// <returns></returns>
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
        public List<NBFModel.Model_IndustryConfig> GetFundIndustryConfig(string jjdm)
        {
            FundMarket market = new FundMarket();
            return market.GetFundIndustryConfig(jjdm);
        }

        /// <summary>
        /// 获取基金重仓持股信息
        /// </summary>
        /// <param name="jjdm">系统基金代码</param>
        /// <returns></returns>
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
        public List<NBFModel.Model_FundHoldStock> GetFundHoldStock(string jjdm)
        {
            FundMarket market = new FundMarket();
            return market.GetFundHoldStock(jjdm);
        }

        /// <summary>
        /// 获取基金交叉持股信息
        /// </summary>
        /// <param name="jjdm"></param>
        /// <returns></returns>
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
        public List<NBFModel.Model_FundCrossStock> GetFundCrossStock(string jjdm)
        {
            FundMarket market = new FundMarket();
            return market.GetFundCrossStock(jjdm);
        }

        /// <summary>
        /// 获取基金规模
        /// </summary>
        /// <param name="jjdm"></param>
        /// <returns></returns>
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
        public List<NBFModel.Model_FundScale> GetFundScale(string jjdm)
        {
            FundMarket market = new FundMarket();
            return market.GetFundScale(jjdm);
        }

        /// <summary>
        /// 获取基金公司
        /// </summary>
        /// <param name="jjdm"></param>
        /// <returns></returns>
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
        public List<NBFModel.Model_FundCompany> GetFundCompany(string jjdm)
        {
            FundMarket market = new FundMarket();
            return market.GetFundCompany(jjdm);
        }

        /// <summary>
        /// 获取同期发行基金
        /// </summary>
        /// <param name="jjdm"></param>
        /// <returns></returns>
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
        public List<NBFModel.Model_FundSamilerDate> GetFundSamilerDate(string jjdm)
        {
            FundMarket market = new FundMarket();
            return market.GetFundSamilerDate(jjdm);
        }
        
        /// <summary>
        /// 获取同公司发行基金
        /// </summary>
        /// <param name="jjdm"></param>
        /// <returns></returns>
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
        public List<NBFModel.Model_FundSamilerCompany> GetFundSamilerCompany(string jjdm)
        {
            FundMarket market = new FundMarket();
            return market.GetFundSamilerCompany(jjdm);
        }

        /// <summary>
        /// 获取同类型基金
        /// </summary>
        /// <param name="jjdm"></param>
        /// <returns></returns>
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
        public List<NBFModel.Model_FundSamilerType> GetFundSamilerType(string jjdm)
        {
            FundMarket market = new FundMarket();
            return market.GetFundSamilerType(jjdm);
        }

        /// <summary>
        /// 获取基金净值列表
        /// </summary>
        /// <param name="jjdm"></param>
        /// <returns></returns>
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare, ResponseFormat = WebMessageFormat.Json)]
        public List<NBFModel.Model_FundDWJZList> GetFundDWJZList(string jjdm)
        {
            FundMarket market = new FundMarket();
            return market.GetFundDWJZList(jjdm);
        }

        #endregion
    }
}
